package com.eedi.framework.oauth2.enums;


import com.eedi.framework.common.exception.ErrorCode;
import com.eedi.org.enums.OrgErrorCode;
import com.eedi.org.enums.OrgErrorCodeType;
import com.eedi.sys.enums.SysErrorCode;
import com.eedi.sys.enums.SysErrorCodeType;

/**
 * Org 错误码枚举类
 *
 * org 系统，使用 1-002-000-000 段
 */
public interface OrgOauth2ErrorCodeConstants {



    // ========== OAuth2 客户端  =========
    ErrorCode ORG_OAUTH2_CLIENT_NOT_EXISTS = new OrgErrorCode(OrgErrorCodeType.OAUTH2,1, "OAuth2 客户端不存在");
    ErrorCode ORG_OAUTH2_CLIENT_EXISTS = new OrgErrorCode(OrgErrorCodeType.OAUTH2,2, "OAuth2 客户端编号已存在");
    ErrorCode ORG_OAUTH2_CLIENT_DISABLE = new OrgErrorCode(OrgErrorCodeType.OAUTH2,3, "OAuth2 客户端已禁用");
    ErrorCode ORG_OAUTH2_CLIENT_AUTHORIZED_GRANT_TYPE_NOT_EXISTS = new OrgErrorCode(OrgErrorCodeType.OAUTH2,4, "不支持该授权类型");
    ErrorCode ORG_OAUTH2_CLIENT_SCOPE_OVER = new OrgErrorCode(OrgErrorCodeType.OAUTH2,5, "授权范围过大");
    ErrorCode ORG_OAUTH2_CLIENT_REDIRECT_URI_NOT_MATCH = new OrgErrorCode(OrgErrorCodeType.OAUTH2,6, "无效 redirect_uri: {}");
    ErrorCode ORG_OAUTH2_CLIENT_CLIENT_SECRET_ERROR = new OrgErrorCode(OrgErrorCodeType.OAUTH2,7, "无效 client_secret: {}");

    // ========== OAuth2 授权  =========
    ErrorCode ORG_OAUTH2_GRANT_CLIENT_ID_MISMATCH = new OrgErrorCode(OrgErrorCodeType.OAUTH2,8, "client_id 不匹配");
    ErrorCode ORG_OAUTH2_GRANT_REDIRECT_URI_MISMATCH = new OrgErrorCode(OrgErrorCodeType.OAUTH2,9, "redirect_uri 不匹配");
    ErrorCode ORG_OAUTH2_GRANT_STATE_MISMATCH = new OrgErrorCode(OrgErrorCodeType.OAUTH2,10, "state 不匹配");
    ErrorCode ORG_OAUTH2_GRANT_CODE_NOT_EXISTS = new OrgErrorCode(OrgErrorCodeType.OAUTH2,11, "code 不存在");

    // ========== OAuth2 授权  =========
    ErrorCode ORG_OAUTH2_CODE_NOT_EXISTS = new OrgErrorCode(OrgErrorCodeType.OAUTH2,12, "code 不存在");
    ErrorCode ORG_OAUTH2_CODE_EXPIRE = new OrgErrorCode(OrgErrorCodeType.OAUTH2,13, "code 已过期");
    ErrorCode SYS_OAUTH2_REFRESH_TOKEN_ERROR = new SysErrorCode(SysErrorCodeType.OAUTH2,14, "刷新TOKEN失败");

    // ========== AUTH 模块 ==========
    ErrorCode ORG_AUTH_LOGIN_BAD_CREDENTIALS = new OrgErrorCode(OrgErrorCodeType.OAUTH2,14, "登录失败，账号密码不正确");
    ErrorCode ORG_AUTH_LOGIN_USER_DISABLED = new OrgErrorCode(OrgErrorCodeType.OAUTH2,15, "登录失败，账号被禁用");
    ErrorCode ORG_AUTH_LOGIN_CAPTCHA_CODE_ERROR = new OrgErrorCode(OrgErrorCodeType.OAUTH2,16, "验证码不正确，原因：{}");
    ErrorCode ORG_AUTH_THIRD_LOGIN_NOT_BIND = new OrgErrorCode(OrgErrorCodeType.OAUTH2,17, "未绑定账号，需要进行绑定");
    ErrorCode ORG_AUTH_TOKEN_EXPIRED = new OrgErrorCode(OrgErrorCodeType.OAUTH2,18, "Token 已经过期");
    ErrorCode ORG_AUTH_MOBILE_NOT_EXISTS = new OrgErrorCode(OrgErrorCodeType.OAUTH2,19, "手机号不存在");


}
